home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14286 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  602 b 

  1. Path: leroy.cc.uregina.ca!ibp2
  2. From: ibp2@leroy.cc.uregina.ca (Chris Gerber)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: accessing structures via pointers
  5. Date: 12 Apr 1996 20:44:59 GMT
  6. Organization: University of Regina
  7. Message-ID: <4kmfcb$g46@sue.cc.uregina.ca>
  8. References: <1996Apr8.144012.25767@leeds.ac.uk>
  9. NNTP-Posting-Host: leroy.cc.uregina.ca
  10. X-Newsreader: Tin 1.1 PL4
  11.  
  12. > I need something like
  13. > printf("the group name is %s\n",tempgroup.gr_name);
  14. > but that doesnt work because tempgroup is a pointer. 
  15. > How do I do this?
  16.  
  17. Two ways at least:
  18.  
  19. (*tempgroup).gr_name
  20.  
  21. __or__
  22.  
  23. tempgroup->gr_name
  24. -chris
  25.